package org.example.sunrise.sprites;

import lombok.Setter;

import java.util.Random;

@Setter
public class Sun extends Sprite {
    private double bound = new Random().nextDouble(50, 540);

    public Sun() {
        super("sun/Sun_0.png", 60, 60);
        setPositionX(new Random().nextInt(770));
        setVelocityY(30);
    }

    @Override
    public void update() {
        if (getPositionY() < bound) {
            setPositionX(getPositionX() + getVelocityX() / 60);
            setPositionY(getPositionY() + getVelocityY() / 60);
        }
    }
}
